package com.fulihui.wgj.consumer.result;

import lombok.Data;

/**
 * @author: LiuJie
 * @version: 2018/7/23 16:35
 * @description:
 */
@Data
public class BatchSendResult {
    private int successNum;
    private int failNum;

    public void successAddOne(){
        successNum += 1;
    }
    public void failAddOne(){
        failNum += 1;
    }
    public int getTotal(){
        return successNum + failNum;
    }

    /**
     * 计数器自增，true 表示成功、false 表示失败
     * @param b
     */
    public void add(boolean b){
        if(b){
            successAddOne();
        }else {
            failAddOne();
        }
    }
}
